package com.neusoft.nepm.service.impl;

import com.neusoft.nepm.mapper.GridProvinceMapper;
import com.neusoft.nepm.po.GridProvince;
import com.neusoft.nepm.service.IGridProvinceService;
import com.neusoft.nepm.vo.ResponseData;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zouran
 * createDate：2023/6/19  13:23
 */
@Service
public class GridProvinceImpl implements IGridProvinceService {

    @Resource
    private GridProvinceMapper mapper;

    /**
     * 查询省份
     * @return
     */
    @Override
    public ResponseData<List<GridProvince>> listGridProvinceAll() {
        ResponseData data = new ResponseData<>();
        List list = mapper.selectList(null);
        if(list==null){
            data.setCode(2001);
            data.setMessage("数据库查询省份失败");
            return data;
        }
        data.setCode(200);
        data.setMessage("success");
        data.setResult(list);
        return data;
    }
}
